package com.tedu.pj.sys.controller;

import com.tedu.pj.common.annotation.RequiredLog;
import com.tedu.pj.common.pojo.PageObject;
import com.tedu.pj.common.pojo.Response;
import com.tedu.pj.sys.pojo.SysLog;
import com.tedu.pj.sys.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *
 * </p>
 *
 * @author Song
 * @since 2020/10/15
 */

@RestController
@RequestMapping("/log")
public class SysLogContoller {

    @Autowired
    SysLogService sysLogService;

    @RequiredLog("查询日志")
    @GetMapping("/doFindPageObjects")
    public Response doFindPageObjects(String username, Integer pageCurrent) {
        PageObject<SysLog> pageObject = sysLogService.findPageObjects(username, pageCurrent);
        return new Response(pageObject);
    }

    @RequiredLog("删除日志")
    @RequestMapping("/doDeleteObjects")
    public Response doDeleteObjects(Integer... ids) {
        sysLogService.deleteObjects(ids);
        return new Response();
    }


}
